<?php abstract class iface extends RRDTemplate implements iRRDTemplate {
	protected static $CreateStr = '--step 60 DS:inPackets:DERIVE:300:0:U DS:outPackets:DERIVE:300:0:U DS:inBytes:DERIVE:300:0:%max% DS:outBytes:DERIVE:300:0:%max% RRA:AVERAGE:0.5:1:5000 RRA:AVERAGE:0.5:5:5000 RRA:AVERAGE:0.5:60:5000';
	public static function Feed ($Time, $Host, $Data) {
		list ($Name, $Max, $Data) = explode (',', $Data, 3);
		$Filename = parent::Filename ($Host, '', $Name);
		switch (substr ($Max, -1)) {
			case 'G': case 'g': $Max = $Max * 1000000000; break;
			case 'M': case 'm': $Max = $Max * 1000000; break;
			case 'K': case 'k': $Max = $Max * 1000; break;
		}
		$Max = round ($Max / 8); // convert bits to bytes;
		parent::Create ($Filename, str_replace ('%max%', $Max, self::$CreateStr));
		parent::Feed ($Filename, $Time, $Data);
	}
} ?>